package com.ruoyi.core.domain.custombean;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.util.Assert;

import java.util.Date;

/**
 * 客户端用户产品 权限使用情况
 */
public class ClientUserProductUsageRightQueryResult {



    private Long productId;

    /**
     *  产品名
     */
    private String productName;

    /**
     * 时长
     */
    private String clientUserDuration;

    /**
     * 时长 (天)
     */
    private Long clientUserDurationDay;


    private Long clientUserId;
    /**
     * 激活时间
     */
    private Date clientUserActiveTime;


    /**
     * 到期时间
     */
    private Date clientUserExpireTime;


    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getClientUserDuration() {

        Assert.notNull(this.clientUserActiveTime, "客户端用户创建时间不允许为空");
        Assert.notNull(this.clientUserExpireTime, "客户端用户到期时间不允许为空");
        this.clientUserDuration = DateUtils.getDatePoorOnDayAndHour(this.clientUserExpireTime, this.clientUserActiveTime);
        return clientUserDuration;
    }

    public Long getClientUserDurationDay() {
        this.clientUserDurationDay = DateUtils.getDatePoorOnDay(this.clientUserExpireTime, this.clientUserActiveTime);
        return clientUserDurationDay;
    }

    public void setClientUserDuration(String clientUserDuration) {
        this.clientUserDuration = clientUserDuration;
    }

    public Date getClientUserActiveTime() {
        return clientUserActiveTime;
    }

    public void setClientUserActiveTime(Date clientUserActiveTime) {
        this.clientUserActiveTime = clientUserActiveTime;
    }

    public Date getClientUserExpireTime() {
        return clientUserExpireTime;
    }

    public void setClientUserExpireTime(Date clientUserExpireTime) {
        this.clientUserExpireTime = clientUserExpireTime;
    }

    public Long getClientUserId() {
        return clientUserId;
    }

    public void setClientUserId(Long clientUserId) {
        this.clientUserId = clientUserId;
    }
}
